CC = gcc 
CFLAGS = -g -I/home/peter/Keyes/petsc/petsc-2.3.3-p15/include -I/usr/include/mpi -I/usr/include/petsc 
CLIBS = -lpetsc -lpetscmat -lpetscvec -lpetscksp -lcblas
CMACROS = 
LD = ld
RM = rm -f
CD = cd

all: test_petsc.c ex8.c ksp
	$(CC) $(CFLAGS) $(CMACROS) $(CLIBS) test_petsc.c -o test_petsc
	$(CC) $(CFLAGS) $(CMACROS) $(CLIBS) ex8.c -o ex8
	$(CC) $(CFLAGS) $(CMACROS) $(CLIBS) ex1.c -o ex1

#KSPPREFIX = ksp
#.PHONY: ksp
#ksp: 
#	$(CD) $(KSPPREFIX) && $(CC) $(CFLAGS) $(CMACROS) $(CLIBS) ex10.c -o ex10
#	$(CD) $(KSPPREFIX) && $(CC) $(CFLAGS) $(CMACROS) $(CLIBS) ex1.c -o ex1

clean:
	$(RM) *.o *~ *.output test_petsc ex8 
	$(CD) $(KSPPREFIX) && $(RM) *.o *~ *.output ex10 ex1
